Repository navigation
test: check that FileStores gets an aligned slice instead of its size, which depends on where malloc puts the buffer - #103
Conversation
…, which depends on where malloc puts the buffer
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
There was a problem hiding this comment.
The test now verifies that the aligned slice is block-aligned, has at least one block of capacity, and its capacity is a whole multiple of the block size. This replaces a flaky assertion that printed the raw capacity, which varied between one or two blocks depending on the malloc address.
review-bot, model nvidia/nemotron-3-ultra-550b-a55b:free, verdict approve
What this changes
FileStoresprinted the capacity ofByteBuffer.allocateDirect(2 * block).alignedSlice(block). That capacity is one or two blocks depending on whether the buffer's address happens to be block-aligned, which for HotSpot depends on where malloc puts it, so the expected output changes from run to run. The program now prints whether the slice is block-aligned and a whole number of blocks, which holds on both.Tests
FileStoreson HotSpot three times and on java-web: identical output,aligned slice true.